Sets the information in the data set from the specified class instances.
[ExtensionAttribute()]public static void Set(Leadtools.Dicom.DicomDataSet ds,bool addOptional,params object[] instances)
<ExtensionAttribute()>Public Overloads Shared Sub Set( _ByVal ds As Leadtools.Dicom.DicomDataSet, _ByVal addOptional As Boolean, _ByVal ParamArray instances() As Object _)
[ExtensionAttribute()]public:static void Set(Leadtools.Dicom.DicomDataSet^ ds,bool addOptional,... array<Object^>^ instances)
ds
The data sets to set information into.
addOptional
If set to true, add optional elements from the class instance.
instances
The instances that have the correct attributes.
This example omits optional items from the data set.
using Leadtools.Dicom.Common.DataTypes;using Leadtools.Dicom.Common.Extensions;using Leadtools.Dicom;using Leadtools.Dicom.Common.Editing.Converters;using Leadtools.Dicom.Common.Editing;public class PatientInfoTest{private PersonName _PatientName;[Element(DicomTag.PatientName, Optional = true)][TypeConverter(typeof(PersonNameConverter))]public PersonName PatientName{get { return _PatientName; }set { _PatientName = value; }}private string _PatientID;[Element(DicomTag.PatientID, Optional = false)]public string PatientID{get { return _PatientID; }set { _PatientID = value; }}}public void OptionalTest(){PatientInfoTest info = new PatientInfoTest();// Initialize the DICOM engineDicomEngine.Startup();DicomDataSet ds = new DicomDataSet();// Initialize an empty datasetds.Initialize(DicomClassType.Undefined, DicomDataSetInitializeFlags.None);//// Initialize Patient Information//info.PatientName = new PersonName("LAST^FIRST");info.PatientID = "123456";//// Set the patient information//ds.Set(false, info);//// Patient Name should not exist since we did not add any optional elements//DicomElement element = ds.FindFirstElement(null, DicomTag.PatientName, false);if (element == null)Console.WriteLine("Patient Name not added");DicomEngine.Shutdown();}
Imports Leadtools.Dicom.Common.DataTypesImports Leadtools.Dicom.Common.ExtensionsImports Leadtools.DicomImports Leadtools.Dicom.Common.Editing.ConvertersImports Leadtools.Dicom.Common.EditingPublic Class PatientInfoTestPrivate _PatientName As PersonName<Element(DicomTag.PatientName, Optional:=True), TypeConverter(GetType(PersonNameConverter))>Public Property PatientName() As PersonNameGetReturn _PatientNameEnd GetSet(value As PersonName)_PatientName = valueEnd SetEnd PropertyPrivate _PatientID As String<Element(DicomTag.PatientID, Optional:=False)>Public Property PatientID() As StringGetReturn _PatientIDEnd GetSet(value As String)_PatientID = valueEnd SetEnd PropertyEnd Class<TestMethod>Public Sub OptionalTest()Dim info As PatientInfoTest = New PatientInfoTest()' Initialize the DICOM engineDicomEngine.Startup()Dim ds As DicomDataSet = New DicomDataSet()' Initialize an empty datasetds.Initialize(DicomClassType.Undefined, DicomDataSetInitializeFlags.None)'' Initialize Patient Information'info.PatientName = New PersonName("LAST^FIRST")info.PatientID = "123456"'' Set the patient information'ds.Set(False, info)'' Patient Name should not exist since we did not add any optional elements'Dim element As DicomElement = ds.FindFirstElement(Nothing, DicomTag.PatientName, False)If element Is Nothing ThenConsole.WriteLine("Patient Name not added")End IfDicomEngine.Shutdown()End Sub
|
Products |
Support |
Feedback: Set(DicomDataSet,Boolean,Object[]) Method - Leadtools.Dicom.Common |
Introduction |
Help Version 19.0.2017.6.23
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.